<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        .text {
            width: 640px;
            margin: 0 auto;
        }

        .article-info {
            color: #999;
            font-size: 14px;
        }

        p {
            font-size: 16px;
            line-height: 30px;
        }
    </style>
    <script src="./axios.js"></script>
    <script src="./jquery-3.5.1.js"></script>
</head>

<body>
    <div class="text">
        <!-- <h1 class="title">新闻标题</h1>
        <div class="article-info"> 类型：纵火 时间：2019-6-18</div>
        <p class="content">
            新闻内容新闻内容 新闻内容新闻内容 新闻内容新闻内容
        </p> -->
    </div>
</body>
<script>
    let id = window.localStorage.getItem('dataId')
    axios({
        method: 'get',
        url: 'http://localhost:2345/news',
        params: {
            id
        }
    }).then(res => {
        let { data: list } = res
        let { type, imgUrl, addTime, content, title } = list[0]
        $('.text').html(`<h1 class="title">${title}</h1>
        <div class="article-info"> 类型：${type} 时间：${addTime}</div>
        <p class="content">
            ${content}
        </p>`)

    })

</script>

</html>